import { Button, Modal } from 'antd';
import './style/index';

export interface Props {
  open?: boolean;
  content?: string;
  onOk?: (...args: any[]) => any;
  onCancel?: (...args: any[]) => any;
}

function DeleteModal(props: Props) {
  const { open, content } = props;
  const modalProps = {
    open,
    className: 'stong-delete-modal',
    title: '提示',
    width: 420,
    footer: [
      <Button key="cancel" onClick={props.onCancel}>
        取消
      </Button>,
      <Button key="confirm" danger type="primary" onClick={props.onOk}>
        确认
      </Button>,
    ],
    onOk: props.onOk,
    onCancel: props.onCancel,
  };
  return (
    <Modal {...modalProps}>
      <div className="modals-body">
        <span className="modals-content">{content}</span>
      </div>
    </Modal>
  );
}

export default DeleteModal;
